#include <arch.h>
#include <t8.h>
#include <config.h>
#include <i2c.h>

int printf(const char *fmt, ...);

void backlight_off()
{
    I2cWriteByte(0x92, 0x25, 0x00);
}

void backlight_on()
{
    I2cWriteByte(0x92, 0x25, 0x47);
}

void backlight_setbrightness(int val)
{
    unsigned char regVal = 0x40 | (val & 0x7); // 0 <= val <= 7
    I2cWriteByte(0x92, 0x25, regVal);
}
